An optical sensor which optically detects the presence or absence of an object, the state of an object, and the like through the use of light intercepted or reflected, for example, by the object. An example of such an optical sensor includes a photointerrupter which detects the presence or absence of an object, based on the interception of light (see PTL 1, for example). As shown in FIG. 12, this photointerrupter includes a light-emitting element 3 and a light-receiving element 4 which are opposed to each other, with a space S therebetween. Light emitted from the light-emitting element 3 passes through the space S and is received directly by the light-receiving element 4. When an object that is an object M to be detected is present in the space S, light emitted from the light-emitting element 3 is intercepted by the object, and the light-receiving element 4 senses the interception of light, whereby the photo interrupter detects the presence of the object. Such a photointerrupter is installed, for example, in a sheet feeder of a printer, and is configured to detect the presence or absence of a sheet in the sheet feeder.
Another example of the optical sensor includes a proximity sensor which detects the presence or absence of an object, based on the reflection of light (see PTL 2, for example). As shown in FIG. 13, this proximity sensor includes the light-emitting element 3 and the light-receiving element 4 which are oriented toward the same side (upward as seen in FIG. 13). When an object that is the object M to be detected is present at a predetermined position (distance) in the space S on the side toward which the light-emitting element 3 and the light-receiving element 4 are oriented, light emitted from the light-emitting element 3 is reflected from the object, and the reflected light is received directly by the light-receiving element 4. When the object is absent at that position, the light emitted from the light-emitting element 3 is not reflected from the object or the reflected light, if any, is not received by the light-receiving element 4. In this manner, the proximity sensor is configured to detect the presence or absence of the object in the direction of light emission from the light-emitting element 3 (an upward direction as seen in FIG. 13), based on whether the reflected light is received by the light-receiving element 4 or not. Such a proximity sensor is installed, for example, in a cellular mobile phone, and is configured to detect the presence of a face (ear) near the cellular mobile phone during a phone conversation. Thus, a display is light-controlled on a display screen of the cellular mobile phone, so that the lifetime of a battery in the cellular mobile phone is increased.